package com.yuzhihao.writejvm.format;

/**
 * 目标类型
 *
 * @author yzh
 * @since 2021年12月11日17:51:36
 */
public enum TargetTypeEnum {
    //
    class_or_interface(0,"00","0x00","type parameter declaration of generic class or interface","type_parameter_target","ClassFile"),
    method_or_constructor(1,"01","0x01","type parameter declaration of generic method or constructor","type_parameter_target","method_info"),
    implements_extends(16,"10","0x10","type in extends or implements clause of class declaration (including the direct superclass or direct superinterface of an anonymous class declaration), or in extends clause of interface declaration","supertype_target","ClassFile"),
    bound_class_or_interface(17,"11","0x11","type in bound of type parameter declaration of generic class or interface","type_parameter_bound_target","ClassFile"),
    bound_method_or_constructor(18,"12","0x12","type in bound of type parameter declaration of generic method or constructor","type_parameter_bound_target","method_info"),
    field(19,"13","0x13","type in field declaration","empty_target","field_info"),
    return_method(20,"14","0x14","return type of method, or type of newly constructed object","empty_target","method_info"),
    receiver_method_or_constructor(21,"15","0x15","receiver type of method or constructor","empty_target","method_info"),
    formal_method_constructor_or_lambda(22,"16","0x16","type in formal parameter declaration of method, constructor, or lambda expression","formal_parameter_target","method_info"),
    throws_method_or_constructor(23,"17","0x17","type in throws clause of method or constructor","throws_target","method_info"),

    local(64,"40","0x40","type in local variable declaration","localvar_target","Code"),
    resource(65,"41","0x41","type in resource variable declaration","localvar_target","Code"),
    exception_parameter (66,"42","0x42","type in exception parameter declaration","catch_target","Code"),
    instanceof_expression(67,"43","0x43","type in instanceof expression","offset_target","Code"),
    new_expression(68,"44","0x44","type in new expression","offset_target","Code"),
    method_reference_expression_using_new(69,"45","0x45","type in method reference expression using ::new","offset_target","Code"),
    method_reference_expression_using_identifier(70,"46","0x46","type in method reference expression using ::Identifier","offset_target","Code"),
    cast_expression(71,"47","0x47","type in cast expression","type_argument_target","Code"),
    constructor_invocation(72,"48","0x48","type argument for generic constructor in new expression or explicit constructor invocation statement","type_argument_target","Code"),
    method_invocation(73,"49","0x49","type argument for generic method in method invocation expression","type_argument_target","Code"),
    constructor_new(74,"4A","0x4A","type argument for generic constructor in method reference expression using ::new","type_argument_target","Code"),
    constructor_Identifier(75,"4B","0x4B","type argument for generic method in method reference expression using ::Identifier","type_argument_target","Code"),
    ;

    private final int value;
    private final String value16;
    private final String value16x;
    private final String kind;
    private final String item;
    private final String location;

    TargetTypeEnum(int value, String value16, String value16x, String kind, String item, String location) {
        this.value = value;
        this.value16 = value16;
        this.value16x = value16x;
        this.kind = kind;
        this.item = item;
        this.location = location;
    }

    public int getValue() {
        return value;
    }

    public String getValue16() {
        return value16;
    }

    public String getValue16x() {
        return value16x;
    }

    public String getKind() {
        return kind;
    }

    public String getItem() {
        return item;
    }

    public String getLocation() {
        return location;
    }
}
